<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	
	<f:view contentType="text/html" >
		<h:head>
			<h:outputStylesheet library="css" name="style.css" />
			<title>
				<ui:insert name="page-title" >Title</ui:insert>
			</title>
	  	</h:head>
		<h:body>
			
			<p:layout fullPage="true">  
			    <p:layoutUnit position="north" size="50">
			    	<h:form>
				    	<p:commandLink action="home" value="Home"  style="margin: 5px; float: left"/>
				    	<p:commandLink action="#{loginController.logoutAction}" value="Logout"  style="margin: 5px; float: right"/>
					    <p:commandLink action="utilizador" value="#{loginController.utilizador.username}" style="margin: 5px; float: right">
						    <f:param name="utilizadorId" value="#{loginController.utilizador.id}" />
			            </p:commandLink>
				    </h:form>
			    </p:layoutUnit>  
			  
			    <p:layoutUnit position="west" size="200" styleClass="left-menu"> 
			    	
			    	<h:form> 
			    		
				        <p:slideMenu > 
				        	<p:submenu label="Pedidos" >  
					            <p:menuitem value="#{messages.novoPedido}" action="#{pedidoController.novoPedido}"  ajax="false"/>  
					            <p:menuitem value="Listar Pedidos" action="pedidos"  ajax="false"/>  
					        </p:submenu> 
					       	<p:menuitem value="#{messages.mercadorias}" action="mercadorias"  ajax="false"/>  
					       	<p:menuitem value="#{messages.centrosDepositos}" action="centroDepositos"  ajax="false"/>  
					       	<p:menuitem value="#{messages.entradaStock}" action="#{entradaController.novaEntrada}"  ajax="false"/>
					       	<p:menuitem value="#{messages.relatorios}" action="relatorios" ajax="false" rendered="#{!loginController.operador}"/>
					       	<p:menuitem value="#{messages.utilizadores}" action="utilizadores"  ajax="false" rendered="#{loginController.administrador}"/>
					    </p:slideMenu > 
				    </h:form> 
			    </p:layoutUnit>  
			  
			    <p:layoutUnit position="center">  
			        <h:form>
			        	<div style="padding: 10px">
			           		<ui:insert name="center">center</ui:insert>
			           	</div>
			        </h:form>   
			    </p:layoutUnit>  
			</p:layout>  
			
			<p:ajaxStatus rendered="false" style="width:64px;height:64px;position:fixed;right:5px;bottom:5px">  
			    <f:facet name="start">  
			        <p:graphicImage library="images" name="loader.gif" />  
			    </f:facet>  
			  
			    <f:facet name="complete">  
			        <h:outputText value="" />  
			    </f:facet>  
			</p:ajaxStatus>
		
		</h:body>
	</f:view>
</html>